package two_xia.ex7.Demo02;

public class Office extends OrganizationComponent {
    private String name;

    public String getName() {
        return this.name;
    }

    public void setName(String newName) {
        this.name = newName;
    }

    public void addComponent(OrganizationComponent organizationComponent) {
        System.out.println("error method");
    }

    public void removeComponent(OrganizationComponent organizationComponent) {
        System.out.println("error method");
    }

    public OrganizationComponent getChild() {
        System.out.println("error method");
        return null;
    }

    public void sendMessage(String msg) {
        System.out.println("error method");
    }

    public void onMessage() {
        System.out.println(this.getName() + "接收公文");
    }

}